package ${dir}.service.impl;


import java.util.List;
import ${dir}.service.${table.name!}Service;
import ${dir}.mapper.${table.name!}Mapper;
import ${dir}.entity.${table.name!};
import java.io.Serializable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ${table.name!}ServiceImpl implements ${table.name!}Service {
	@Autowired
	${table.name!}Mapper ${table.lowcasename}Mapper;
	
	@Override
	public boolean save${table.name!}(${table.name!} obj) {
		if(${table.lowcasename}Mapper.add(obj)>0){
			return true;
		}
		return false;
	}
	
	public boolean edit${table.name!}(${table.name!} obj) {
		if(${table.lowcasename}Mapper.update(obj)>0){
			return true;
		}
		return false;
	}
	
	public boolean delete${table.name!}(Serializable id) {
		if(${table.lowcasename}Mapper.delete(id)>0){
			return true;
		}
		return false;
	}

	@Override
	public ${table.name!} get${table.name!}(Serializable id) {
		return ${table.lowcasename}Mapper.selectOne(id);
	}

	@Override
	public List<${table.name!}> getAll() {
		return ${table.lowcasename}Mapper.selectAll();
	}
}
